<?php

/**
 * Docente form base class.
 *
 * @package    form
 * @subpackage docente
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseDocenteForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_docente'              => new sfWidgetFormInputHidden(),
      'nm_docente'              => new sfWidgetFormInput(),
      'nu_ordem'                => new sfWidgetFormInput(),
      'nu_matricula'            => new sfWidgetFormInput(),
      'nm_mae'                  => new sfWidgetFormInput(),
      'nm_pai'                  => new sfWidgetFormInput(),
      'nm_conjuge'              => new sfWidgetFormInput(),
      'dt_nascimento'           => new sfWidgetFormDate(),
      'sg_nacionalidade'        => new sfWidgetFormInput(),
      'sg_estado_civil'         => new sfWidgetFormChoice(array('choices' => array('S' => 'S', 'C' => 'C', 'D' => 'D', 'V' => 'V'))),
      'nm_cidade_nascimento'    => new sfWidgetFormInput(),
      'sg_uf_nascimento'        => new sfWidgetFormInput(),
      'nu_ci'                   => new sfWidgetFormInput(),
      'ds_ci_orgao_emissor'     => new sfWidgetFormInput(),
      'sg_ci_uf'                => new sfWidgetFormInput(),
      'nu_ctps'                 => new sfWidgetFormInput(),
      'nu_ctps_serie'           => new sfWidgetFormInput(),
      'nu_reservista'           => new sfWidgetFormInput(),
      'nu_reservista_categoria' => new sfWidgetFormInput(),
      'nu_cpf'                  => new sfWidgetFormInput(),
      'ds_endereco'             => new sfWidgetFormInput(),
      'sg_endereco_uf'          => new sfWidgetFormInput(),
      'nu_endereco_cep'         => new sfWidgetFormInput(),
      'dt_admissao'             => new sfWidgetFormDate(),
      'dt_demissao'             => new sfWidgetFormDate(),
      'ds_cargo'                => new sfWidgetFormInput(),
      'nu_salario'              => new sfWidgetFormInput(),
      'ds_forma_pagamento'      => new sfWidgetFormInput(),
      'nu_pis'                  => new sfWidgetFormInput(),
      'dt_pis_cadastro'         => new sfWidgetFormDate(),
      'hr_entrada'              => new sfWidgetFormTime(),
      'hr_saida'                => new sfWidgetFormTime(),
      'st_docente'              => new sfWidgetFormInput(),
      'created_at'              => new sfWidgetFormDateTime(),
      'updated_at'              => new sfWidgetFormDateTime(),
      'deleted'                 => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_docente'              => new sfValidatorDoctrineChoice(array('model' => 'Docente', 'column' => 'id_docente', 'required' => false)),
      'nm_docente'              => new sfValidatorString(array('max_length' => 150)),
      'nu_ordem'                => new sfValidatorInteger(array('required' => false)),
      'nu_matricula'            => new sfValidatorInteger(),
      'nm_mae'                  => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nm_pai'                  => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nm_conjuge'              => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'dt_nascimento'           => new sfValidatorDate(array('required' => false)),
      'sg_nacionalidade'        => new sfValidatorString(array('max_length' => 3)),
      'sg_estado_civil'         => new sfValidatorChoice(array('choices' => array('S' => 'S', 'C' => 'C', 'D' => 'D', 'V' => 'V'))),
      'nm_cidade_nascimento'    => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'sg_uf_nascimento'        => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'nu_ci'                   => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'ds_ci_orgao_emissor'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'sg_ci_uf'                => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'nu_ctps'                 => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_ctps_serie'           => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_reservista'           => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'nu_reservista_categoria' => new sfValidatorInteger(array('required' => false)),
      'nu_cpf'                  => new sfValidatorString(array('max_length' => 11, 'required' => false)),
      'ds_endereco'             => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'sg_endereco_uf'          => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'nu_endereco_cep'         => new sfValidatorString(array('max_length' => 8, 'required' => false)),
      'dt_admissao'             => new sfValidatorDate(array('required' => false)),
      'dt_demissao'             => new sfValidatorDate(array('required' => false)),
      'ds_cargo'                => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'nu_salario'              => new sfValidatorNumber(array('required' => false)),
      'ds_forma_pagamento'      => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nu_pis'                  => new sfValidatorString(array('max_length' => 11, 'required' => false)),
      'dt_pis_cadastro'         => new sfValidatorDate(array('required' => false)),
      'hr_entrada'              => new sfValidatorTime(array('required' => false)),
      'hr_saida'                => new sfValidatorTime(array('required' => false)),
      'st_docente'              => new sfValidatorString(array('max_length' => 1)),
      'created_at'              => new sfValidatorDateTime(array('required' => false)),
      'updated_at'              => new sfValidatorDateTime(array('required' => false)),
      'deleted'                 => new sfValidatorBoolean(),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'Docente', 'column' => array('nu_matricula')))
    );

    $this->widgetSchema->setNameFormat('docente[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Docente';
  }

}
